#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QTime>
#include <QLabel>
#include <QString>
#include <unistd.h>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    launchApp("printFiles");
    launchApp("runtime");

//    QLabel label;
//    QString string;
//    QTime time = QTime::currentTime();
//   // hour = time->hour(), minute = time->minute(), second = time->second();
//    string = time.toString();
//    label.setText(string);
//    label.show();
    
    return a.exec();
}

void launchApp(const char *path)
{
    if(path == NULL)
    {
        exit(-1);
    }

    pid_t pid = fork();

    if(pid == 0)
    {
        int result = execl(path, path, 0);
        if(result<0)
        {
            exit(-2);
        }
        exit(0);
    }
}
